Skip to content

Ensure dynamic Bukkit command dispatch runs on Folia entity threads#31

Open
Chwitst187 wants to merge 1 commit intomainfrom
codex/make-all-commands-folia-compatible
Open

Ensure dynamic Bukkit command dispatch runs on Folia entity threads#31
Chwitst187 wants to merge 1 commit intomainfrom
codex/make-all-commands-folia-compatible

Conversation

@Chwitst187
Copy link
Copy Markdown
Owner

Motivation

  • Ensure dynamic commands and tab-completion invoked by player senders are executed on Folia entity threads to avoid thread-safety issues when running on Folia.

Description

  • Add imports for WorldEditPlugin, FoliaEntityTask, and Player and wire Folia checks into the dynamic command code.
  • In execute(...), when WorldEditPlugin.getInstance().isOnFolia() and the sender is a Player, route the handler through FoliaEntityTask.execute(player, ...) and join() the result; otherwise keep the original owner.onCommand(...) call.
  • In tabComplete(...), apply the same Folia-safe dispatch for player senders when registeredWith is a CommandInspector, preserving non-Folia and non-player behavior.

Testing

  • Ran ./gradlew :worldedit-bukkit:compileJava -x test, which failed in this environment due to an unrelated multi-project Gradle configuration error: Task with name 'build' not found in project ':worldedit-libs:cli'.
  • No unit tests were executed in this environment due to the build issue.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant